import { formatPermission } from '@/router/format'
import { storeUserListRoutes } from './list'
import { storeUserCouponListRoutes } from './coupon'
import { storeUserInvoiceRoutes } from './invoice'
import { userAddressRoutes } from './address'

export const storeUserRoutes = {
  path: '/merchant/operation/user',
  name: 'storeOperationUser',
  component: () => import(/* webpackChunkName: "operation-user" */ '@/views/operation/user/index'),
  meta: {
    title: '用户管理',
    icon: 'el-icon-s-custom'
  },
  redirect: '/merchant/operation/user/index',
  permission: formatPermission(require.context('./', true, /^(?!.*(?:index.js$)).*\.js$/)),
  children: [
    storeUserListRoutes,
    storeUserCouponListRoutes,
    storeUserInvoiceRoutes,
    userAddressRoutes
  ],
}
